package com.ruoyi.procured.domain;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import lombok.Data;

/**
 * 采购订单-申请付款对象 tb_payment_request
 *
 * @author 刘广帆
 * @date 2024-10-03
 */
@Data
@TableName(value="tb_payment_request")
public class PaymentRequest
{
    private static final long serialVersionUID = 1L;

    /** 主键 */
    @TableId(value = "payment_request_id")
    private String paymentRequestId;

    @TableField("payment_request_code")
    @Excel(name = " 申请款单号")
    private String paymentRequestCode;

    /**  申请付款审核状态（0审核中，1已审核，2已驳回）*/
    @TableField("payment_review_status")
    @Excel(name = " 申请付款审核状态", readConverterExp = " 0审核中，1已审核，2已驳回")
    private String paymentReviewStatus;


    /**  申请款主表 ID（tb_payment）*/
    @TableField("payment_id")
    @Excel(name = " 申请款主表 ID", readConverterExp = " 申请款主表 ID（tb_payment)")
    private String paymentId;

    /**  关联的采购订单 ID（tb_purchase_orders）*/
    @TableField("procured_order_id")
    @Excel(name = " 关联的采购订单 ID", readConverterExp = " 关联的采购订单 ID（tb_purchase_orders)")
    private String procuredOrderId;

    /** 申请付款状态（0未付款，1已生成付款单，2部分过账，3已过账） */
    @TableField("payment_status")
    @Excel(name = "申请付款状态", readConverterExp = "0未付款，1已生成付款单，2未过账，3已过账，4退款中，5退货退款中，6换货中，7已生成退款单")
    private String paymentStatus;

    /** 申请付款方式（0预付款，1应付款） */
    @TableField("payment_type")
    @Excel(name = "申请付款方式", readConverterExp = "0=预付款，1应付款，2仅退款，3退货退款，4换货")
    private String paymentType;

    /** 预付款周期 */
    @TableField("prepayment_cycle")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "预付款周期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date prepaymentCycle;

    /** 预付款金额 */
    @TableField("prepayment_amount")
    @Excel(name = "预付款金额")
    private BigDecimal prepaymentAmount;

    /** 更新时间 */
    @TableField("prepayment_remark")
    @Excel(name = "更新人")
    private String prepaymentRemark;

    /** 其他费用类型（新增，减少） */
    @TableField("other_fee_type")
    @Excel(name = "其他费用类型", readConverterExp = "新增，减少")
    private String otherFeeType;

    /** 其他费用金额 */
    @TableField("other_fee_amount")
    @Excel(name = "其他费用金额")
    private BigDecimal otherFeeAmount;

    /** 其他费用备注 */
    @TableField("other_fee_remark")
    @Excel(name = "其他费用备注")
    private String otherFeeRemark;

    /** 申请人 */
    @TableField("applicant")
    @Excel(name = "申请人")
    private String applicant;

    /**  申请人ID */
    @TableField("applicant_id")
    private Long applicantId;

    /** 申请时间 */
    @TableField("application_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "申请时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date applicationTime;


    /** 取消申请状态（0未取消，1已取消） */
    @TableField("cancel_status")
    @Excel(name = "取消申请状态", readConverterExp = "0未取消，1已取消")
    private String cancelStatus;

    /** 应付金额*/
    @TableField("payable_amount")
    @Excel(name = "应付金额")
    private BigDecimal payableAmount;

    /**  当前审核用户ID */
    @TableField("reviewer_user_id")
    private Long reviewerUserId;

    /** 是否撤回，0否，1是*/
    @TableField("delete_status")
    private String deleteStatus;

    /** 撤回备注*/
    @TableField("revoke_remark")
    private String revokeRemark;

    /** 退款金额 */
    @TableField("return_amount")
    private BigDecimal returnAmount;
    /** 退款备注 */
    @TableField("return_remark")
    private String returnRemark;
    /** 退款备注 */
    @TableField("return_image")
    private String returnImage;
     /** 标记是否已退款（0未标记，1已标记） */
    @TableField("return_status")
    private String returnStatus;
    /** 处理状态（0未处理，1已处理） */
    @TableField("solve_status")
    private String solveStatus;

    @TableField(exist = false)
    private String ordersNumber;

    @TableField(exist = false)
    private String amountDue;

    @TableField(exist = false)
    private String processStatus;

    @TableField(exist = false)
    private Long reviewerId;

    @TableField(exist = false)
    private List<PaymentReturn> items;

    // **添加无参构造函数**
    public PaymentRequest() {
    }

    /** 更新人 */
    @TableField("update_by")
    @Excel(name = "更新人")
    private String updateBy;

    /** 更新时间 */
    @TableField("update_time")
    @Excel(name = "更新人")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    @TableField(exist = false)
    private String paymentVoucherStatus;

    @TableField(exist = false)
    private String waterBillImg;

    public PaymentRequest(String paymentRequestId, String paymentRequestCode, String paymentReviewStatus, String paymentId, String procuredOrderId,
                          String paymentStatus, String paymentType, Date prepaymentCycle,
                          BigDecimal prepaymentAmount, String prepaymentRemark, String otherFeeType, BigDecimal otherFeeAmount, String otherFeeRemark,
                          String applicant, Long applicantId, Date applicationTime, String cancelStatus, BigDecimal payableAmount, Long reviewerUserId){
        this.paymentRequestId = paymentRequestId;
        this.paymentRequestCode = paymentRequestCode;
        this.paymentReviewStatus = paymentReviewStatus;
        this.paymentId = paymentId;
        this.procuredOrderId = procuredOrderId;
        this.paymentStatus = paymentStatus;
        this.paymentType = paymentType;
        this.prepaymentCycle = prepaymentCycle;
        this.prepaymentAmount = prepaymentAmount;
        this.prepaymentRemark = prepaymentRemark;
        this.otherFeeType = otherFeeType;
        this.otherFeeAmount = otherFeeAmount;
        this.otherFeeRemark = otherFeeRemark;
        this.applicant = applicant;
        this.applicantId = applicantId;
        this.applicationTime = applicationTime;
        this.cancelStatus = cancelStatus;
        this.payableAmount = payableAmount;
        this.reviewerUserId = reviewerUserId;
    }

}
